namespace CloudNinja.Metering.Data.Models
{
    using System.ComponentModel;
    using System.Data.Services.Common;
    using System.Runtime.CompilerServices;

    using CloudNinja.Metering.Data.Annotations;
    

    [DataServiceKey("TenantId", "MeterTypeId", "TimePeriod")]
    [EntitySet("MeterData")]
    public class MeterData : INotifyPropertyChanged
    {
        public string MeterTypeId { get; set; }

        public string TenantId { get; set; }

        public System.DateTime TimePeriod { get; set; }

        public double Value { get; set; }

        public int Count { get; set; }
        public event PropertyChangedEventHandler PropertyChanged;

        [NotifyPropertyChangedInvocator]
        protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
        {
            PropertyChangedEventHandler handler = PropertyChanged;
            if (handler != null)
            {
                handler(this, new PropertyChangedEventArgs(propertyName));
            }
        }
    }
}
